package com.hwl.demo1.service.impl;

import com.hwl.demo1.service.CashSuper;

/**
 * 打折收费
 *
 * @author sentry
 * @since 2023-02-25
 */
public class CashRebate extends CashSuper {

    /**
     * 折扣
     */
    private final double moneyRebate;

    public CashRebate(double moneyRebate) {
        this.moneyRebate = moneyRebate;
    }

    @Override
    public double acceptCash(double price, int num) {
        return price * num * moneyRebate;
    }
}
